.class public Sample_google_search
.super scarlett/ScarlettRuntime
; standard initializer
.method public <init>()V
   aload_0
   invokenonvirtual scarlett/ScarlettRuntime/<init>()V
   return
 .end method
.method public static main([Ljava/lang/String;)V
    .limit stack 16
    .limit locals 2
    new Sample_google_search
    dup
    invokenonvirtual Sample_google_search/<init>()V
    aload_0
    invokenonvirtual Sample_google_search/ScarlettMain([Ljava/lang/String;)V
	return
.end method

.method public  run([Ljava/lang/String;)V
.var 2 is eachURI Ljava/lang/String;
.var 1 is resultURIs Ljava/util/List;
    aconst_null
    astore 2
    aconst_null
    astore 1

	aload_0 ; This ptr for Show command
	ldc "this shows a single line where we are fetching URIs and showing the resulting list :" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "\n" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	aload_0 ; this pointer for Fetch
	; begin source
	ldc "http://www.google.com/search?q=Mak+sjsu" ; httpuri
	; end source
	; begin regex
	aload_0 ; this pointer for regex call
	ldc "uri"
	invokevirtual scarlett/ScarlettRuntime/GetPattern(Ljava/lang/String;)Ljava.util.regex.Pattern;
	; end regex
	invokevirtual scarlett/ScarlettRuntime/Fetch(Ljava/lang/String;Ljava.util.regex.Pattern;)Ljava.util.List;
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "\n" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "\n" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "this shows the result of the fetch being assigned to a variable, then looping through the results :" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "\n" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; this pointer for Fetch
	; begin source
	ldc "http://www.google.com/search?q=Mak+sjsu" ; httpuri
	; end source
	; begin regex
	aload_0 ; this pointer for regex call
	ldc "uri"
	invokevirtual scarlett/ScarlettRuntime/GetPattern(Ljava/lang/String;)Ljava.util.regex.Pattern;
	; end regex
	invokevirtual scarlett/ScarlettRuntime/Fetch(Ljava/lang/String;Ljava.util.regex.Pattern;)Ljava.util.List;
	astore 1
	aload 1 ;load variable resultURIs
	astore 1 ; store the source on TOS into the var
	aload 1 ; store the source on TOS into the var
	; get the iterator 
	invokeinterface java.util.List/iterator()Ljava/util/Iterator; 1
	L000:
	dup
	dup
	; get the next value 
	invokeinterface java.util.Iterator/next()Ljava/lang/Object; 1
	checkcast java/lang/String
	astore 2
	; Loop statements
	aload_0 ; This ptr for Show command
	aload 2 ;load variable eachURI
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	;End Loop statements
	invokeinterface java.util.Iterator/hasNext()Z 1
	ifne L000 ; bottom of loop
    return

.limit locals 7
.limit stack  16
.end method
